<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
</style>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>

<div class="span10">
    <div style="margin-bottom: 20px;">
        <a href="/index/index">首页</a><span >&gt;</span><a href="/applets/index/index">百度小程序管理</a><span >&gt;</span><span>添加/修改</span>
    </div>

    <form name="form" method="post" action="<?php echo baseUrl."/applets/banner/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td>名称*:</td>
                <td>
                    <input  type="text" name="name" value="<?php echo isset($data)? $data['name']:''?>" />
                </td>
            </tr>

            
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原图片:</td>';
                $str .= '<td>';
                $pic = $data['pic'];
                $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                echo $str;
            } ?>

            <tr>
                <td width="120px">上传、修改图片:</td>
                <td>
                    <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr>
                <td>点击量:</td>
                <td>
                    <input type="text" name="viewCount" value="<?php echo isset($data)? $data['viewCount']:''?>" />
                </td>
             </tr>
            <tr>
                <td>排序:</td>
                <td>
                    <input  type="text" name="sort" value="<?php echo isset($data)? $data['sort']:''?>" />
                </td>
            </tr>
            <tr>
                <td>跳转类型:</td>
                <td>
                    <select name="jumpType">
                        <option value ="">请选择</option>
                        <option value ="1" <?php echo isset($data)&& $data['jumpType']==1 ?  'selected':''?>>资讯</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>内容id:</td>
                <td>
                    <input  type="text" name="contentId" value="<?php echo isset($data)? $data['contentId']:''?>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button></td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>

</div>